import { Injectable } from '@nestjs/common';
// import { InjectRepository } from '@nestjs/typeorm'; '@nestjs/typeorm'
// import {Repository} from 'typeorm'
// import {User} from './user.entity'
export type User = any;

@Injectable()
export class UsersService {


    private readonly users = [
        {
            userId:1,
            username:'john',
            password:'changeme'
        },
        {
            userId:2,
            username:'jane',
            password:'guess'
        },
        {
            userId:3,
            username:'jack',
            password:'lin123'
        }
    ]

    async findOne(username:string): Promise<User | undefined>{
        return this.users.find(user => user.username === username)
    }
}
